package spring.spring_blog.pojo.response;

import lombok.Data;

import java.util.List;

/**
 *  返回信息
 *  userInfo, List<userInfo>, blogInfo, boolean
 */
@Data
public class response {
    Boolean success;
    String message;
    Object data;//这里储存的是返回的被包装的类


    public static  response success(String message) {
        response response = new response();
        response.success = true;
        response.message = message;
        System.out.println("response = "+response);

        return response;
    }
    public static  response success(String message, Object data) {
        response response = new response();
        response.success = true;
        response.message = message;
        response.data = data;

        System.out.println("response = "+response);

        return response;
    }


    public static  response fail(String message) {
        response response = new response();
        response.success = false;
        response.message = message;
        return response;
    }
    public static  response fail(String message, Object data) {
        response response = new response();

        response.data = data;
        response.message = message;
        return response;
    }
}
